home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 704 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. From: jdmorris@ix.netcom.com (Jason D. Morris)
  2. Message-ID: <31474f39.7878879@nntp.ix.netcom.com>
  3. X-Original-Date: Wed, 13 Mar 1996 22:45:40 GMT
  4. Path: in2.uu.net!bounce-back
  5. Date: 13 Mar 96 23:49:09 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: stack variables and new constructor
  9. Organization: Netcom
  10. References: <Do7nuy.HsF@ncrcae.ColumbiaSC.ATTGIS.COM>
  11. X-Netcom-Date: Wed Mar 13  2:44:54 PM PST 1996
  12. X-Newsreader: Forte Agent .99d/32.182
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMUdfA+EDnX0m9pzZAQECQQF+MZytslmydvAcpStk5KG0d+1BpJRdRVSj
  15.     PKTH552HUKOcTmfeWU3hhhQ97oDXe/GZ
  16.     =TavA
  17.  
  18. On 13 Mar 96 15:04:23 GMT, "Jon.Cassorla"
  19. <cassorla@casey.columbiasc.ncr.com> wrote:
  20.  
  21. >1) For a variable that is declared locally to a function of a structure 
  22. >   type, is the standard new constructor executed to allocated the 
  23. >   memory for the data structure?
  24.  
  25. new is an operator not a constructor.  The non-overloaded form of
  26. operator new allocates memory in which an object can be constructed.
  27. After the memory is allocated, the object's ctor is called to build
  28. the object from raw memory.
  29.  
  30. >2) When using "new" to allocate data space for a variable of a structure 
  31. >   type (ie no constructor defined), is the resulting memory space zero'd
  32. >   out as a standard?
  33.  
  34. No.
  35.  
  36. Jason
  37. ---
  38. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  39. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  40. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  41. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  42. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  43.